package com.xbj.cloud;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.ConfigurableApplicationContext;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * @author: 观雾
 * @create: 2024-07-24
 * @description:
 **/
@SpringBootApplication
@MapperScan("com.xbj.cloud.db.dao")
@EnableDiscoveryClient //consul服务注册
@RefreshScope //consul 配置动态刷新
public class Pay8001Start {
    private static final Logger LOG =  LoggerFactory.getLogger(Pay8001Start.class);
    public static void main(String[] args) {
        ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(Pay8001Start.class, args);
        //返回一个包含当前活动配置文件名称的字符串数组。在Spring中，配置文件（如application.properties或application.yml）可以定义多个配置文件块，这些块被标记为特定的配置文件（profiles），如dev、test、prod等
        String[] activeProfiles = configurableApplicationContext.getEnvironment().getActiveProfiles();
        LOG.info("pay8001启动成功");
        for (String profile : activeProfiles) {
            LOG.info("当前使用的profile:"+profile);
        }

    }
}
